package com.zd.bms.bean.vo.resp;

import java.math.BigDecimal;

import com.zd.common.bean.model.TicketInfo;
import com.zd.common.common.enums.TicketVerifyTypeEnum;
import com.zd.common.common.utils.DateTimeUtil;

/**
 * 票类型封装类
 * 
 * @author lishi
 * @date 2018年11月24日 下午4:34:27
 */
public class TicketInfoRespVo extends TicketInfo {
	public String getVerifyTypeStr() {
		TicketVerifyTypeEnum type = TicketVerifyTypeEnum.get(getVerifyType());
		if (type == null) {
			return "未知验票方式";
		}
		return type.getValue();
	}

	public String getPriceStr() {
		return BigDecimal.valueOf(Long.valueOf(getPrice())).divide(new BigDecimal(100)).toString() + "元";
	}

	public String getSellTime() throws Exception {
		String startTime = DateTimeUtil.date2String(getStartTime(),"yyyy-MM-dd HH");
		String endTime = DateTimeUtil.date2String(getEndTime(),"yyyy-MM-dd HH");
		return startTime + " 至 " + endTime;
	}

	public String getEffectiveTimeStr() throws Exception {
		return getEffectiveTime() + "天";
	}
	
	public String getStartTimeStr() throws Exception {
		String startTime = DateTimeUtil.date2String(getStartTime());
		return startTime;
	}
	
	public String getEndTimeStr() throws Exception {
		String endTime = DateTimeUtil.date2String(getEndTime());
		return endTime;
	}
}
